<%@ page language="java" contentType="text/html; charset=utf-8"
	pageEncoding="utf-8"%>
<%@ taglib prefix="s" uri="/struts-tags"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>

<script type="text/javascript">
	var borrowDate=document.getElementById("borrowDate");
	var returnDate=document.getElementById("returnDate");
	var behavior=document.getElementById("behaviorId");
	function change(inpu){
		if(inpu.value==0){
			//alert("选中借出");
			returnDate.style.display="none";
			borrowDate.style.display="block";
			//behavior.value="0";
		}else{
			returnDate.style.display="block";
			borrowDate.style.display="none";
			//alert("选中归还");
			//behavior.value="1";
		}
	}
</script>

<h2 class="contentTitle">编辑设备借还信息</h2>
 
<div class="pageContent">
	
	<form method="post" action="Borrow_Save" class="pageForm required-validate"  onsubmit="return validateCallback(this, navTabAjaxDone);">
		<s:if test="editorType!='add'">
			<input type="text"  style="display: none;" name="borrow.borrowid" value="${borrow.borrowid}" >
		</s:if>
		<s:else>
			<input type="text"  style="display: none;" name="borrow.borrowid" value="0" >
		</s:else>
		<input type="hidden" name="editorType" value="${editorType}" />
		
		<div class="pageFormContent nowrap" layoutH="97">
		    <dl>
				<dt>设备编号：</dt>
				<dd> 			  

				<s:if test="editorType=='modify'">
					<input type="text" name="borrow.deviceid" value="${borrow.deviceid}" readonly="readonly" class="required" class=""/>  <!-- textInput -->
				</s:if>	
				<s:else> 
					<input type="text" name="borrow.deviceid" lookupName="device.deviceid" value="${borrow.deviceid}" readonly class="required" class=""/>  <!-- textInput -->
				    <a class="btnLook" href="Device_List_LookUp" lookupGroup="device">查找</a>
				</s:else>
				</dd>
			</dl>
			<dl>
				<dt>借出数量：</dt>
				<dd>
				<s:if test="editorType =='modify'">
					<input type="text" name="borrow.borcount" value="${borrow.borcount}" readonly="readonly" min="1" class="" />  <!-- required projectname -->
				</s:if>
				<s:else>
					<input type="text" name="borrow.borcount" value="${borrow.borcount}" min="1" class="required" />  <!-- required projectname -->
				</s:else>
				</dd>   
			</dl>
			<dl>
				<s:if test="editorType=='modify'">
					<dt>归还数量：</dt>
					<dd>
						<input type="text" name="borrow.retcount" value="${borrow.retcount}"  min="1" class="required" />  <!-- required projectname -->
					</dd>   
				</s:if>
			</dl>
			<dl>
				<dt>借用单位：</dt>
				<dd>
					<input type="text" name="borrow.borunit" value="${borrow.borunit}"  class="required" />  <!-- required projectname -->
				</dd>   
			</dl>
			
			<s:if test="editorType=='modify'">
				<dl>
					<dt>借用单位类型：</dt>
					<dd>
						<select name="borrow.borunittype">
							<option value="内部">内部</option>
							<c:if test="${borrow.borunittype eq '外部'}">
								<option value="外部" selected="selected">外部</option>	
							</c:if>
							<c:if test="${borrow.borunittype!='外部'}">
								<option value="外部" >外部</option>	
							</c:if>
						</select>
					</dd>   
				</dl>
			</s:if>
			<s:if test="editorType!='modify'">
				<dl>
					<dt>借用单位类型：</dt>
					<dd>
						<select name="borrow.borunittype">
							<option value="内部">内部</option>
							<option value="外部">外部</option>		
						</select>
					</dd>   
				</dl>
			</s:if>

			<dl>
				<dt>联系人：</dt>
				<dd>
					<input type="text" name="borrow.contact" value="${borrow.contact}"  class="required" />  <!-- required projectname -->
				</dd>   
			</dl>
			<dl>
				<dt>联系人电话：</dt>
				<dd>
					<input type="text" name="borrow.contel" value="${borrow.contel}"  class="required phone" />  <!-- required projectname -->
				</dd>   
	        </dl>
			
			<s:if test="editorType=='modify'">
				<dl id="borrowDate" style="display:none;">
					<dt>借用日期：</dt>
					<dd>
						<input type="date" readonly="readonly" name="borrow.bordate" value="<s:date name="borrow.bordate" format="yyyy-MM-dd" />" class="date" />  <!-- date required -->
					</dd>
				</dl>
			</s:if>
			
			<s:if test="editorType!='modify'">
				<dl id="borrowDate" >
					<dt>借用日期：</dt>
					<dd>
						<input type="date" name="borrow.bordate" value="<s:date name="borrow.bordate" format="yyyy-MM-dd" />" class="date required" />  <!-- date required -->
					</dd>
				</dl>
			</s:if>
			
			<s:if test="editorType=='modify'">
				<dl id="returnDate">
					<dt>归还日期：</dt>
					<dd>
						<input type="date"  name="borrow.returndate" value="<s:date name="borrow.returndate" format="yyyy-MM-dd" />" class="date required" />  <!-- date required -->
					</dd>
				</dl>
	        </s:if>
	        
	        <s:else>
	        	<dl id="returnDate" style="display: none;">
					<dt>归还日期：</dt>
					<dd>
						<input type="date"  name="borrow.returndate" value="<s:date name="borrow.returndate" format="yyyy-MM-dd" />" class="date" />  <!-- date required -->
					</dd>
				</dl> 
	        </s:else>
			
			<s:if test="editorType=='modify'">
		        <dl>
					<dt>归还操作人员：</dt>
					<dd>
						<input type="text" name="borrow.returnoperator" value="${session.uname}"  class="" readonly="readonly"/>  <!-- required projectname -->
					</dd>   
				</dl>
			</s:if>
			<s:else>
				<dl style="display: none;">
					<dt>归还操作人员：</dt>
					<dd>
						<input type="text" name="borrow.returnoperator" value="${borrow.returnoperator}"  class="" readonly="readonly"/>  <!-- required projectname -->
					</dd>   
				</dl>
			</s:else>
			<s:if test="editorType!='modify'">
				<dl>
					<dt>借出操作人员：</dt>
					<dd>
						<input type="text" name="borrow.borrowoperator" value="${session.uname}"  class="" readonly="readonly"/>  <!-- required projectname -->
					</dd>   
				</dl>
			</s:if>
			<s:else>
				<dl>
					<dt>借出操作人员：</dt>
					<dd>
						<input type="text" name="borrow.borrowoperator" value="${borrow.borrowoperator}"  class="" readonly="readonly"/>  <!-- required projectname -->
					</dd>   
				</dl>
			</s:else>
		
			<dl>
				<dt>备注：</dt>
				<dd>
					<textarea cols="45" rows="10" name="borrow.note"  class="" minlength="0" maxlength="255">${borrow.note}</textarea>
					<%-- <span class="info">*必填(300字以内)</span> --%>
				</dd>
			</dl>
		</div>

		<div class="formBar">
			<ul>
				<li><div class="buttonActive"><div class="buttonContent"><button type="submit">提交</button></div></div></li>
				<li><div class="button"><div class="buttonContent"><button type="button" class="close">取消</button></div></div></li>
			</ul>
		</div>
	</form>
	
</div>

